using KrasDD.Models;
using KrasDD.Services.Interfaces;
using Microsoft.AspNetCore.Mvc;

namespace KrasDD.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class ItemtypeController : BaseController<ITEMTYPE>
    {
        private readonly IItemtypeService _itemtypeService;

        public ItemtypeController(IBaseService<ITEMTYPE> service, IItemtypeService itemtypeService) : base(service)
        {
            _itemtypeService = itemtypeService;
        }

        [HttpGet("{id}/properties")]
        public async Task<List<PROPERTY>> GetProperties(string id)
        {
            return await _itemtypeService.GetPropertiesAsync(id);
        }
    }
}
